package com.wuyou.web.redis.opsFactory;

import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * Created by glinlf's IDEA
 *
 * @Author glinlf
 * @DATE 2018/1/25 12:10
 * Description:
 */

public abstract class BaseRedisOps {

    private StringRedisTemplate temple;

    public void setData(String key, String value) {
        getTemple().opsForValue().set(key, value);
    }

    public String getData(String key) {
        return getTemple().opsForValue().get(key);
    }

    /**
     * 子类重写获取不同连接的redisTemplate
     * @return
     */
    public StringRedisTemplate getTemple() {
        return temple;
    }

}
